﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="DealComments.ascx.cs"
    Inherits="controls_admin_DealComments" %>
<!-- table -->
<script type="text/javascript">
    $(document).ready(function () {
        $(".del").click(function () {
            var ids = "";
            $(".last input[type=checkbox].item").each(function () {
                var checked = $(this).attr("checked");
                if (checked) {
                    ids = ids + $(this).parent().parent().attr("id") + ";";
                }
            });
            if (ids == "") {
                return false;
            }
            else {
                $("#<%=hdfID.ClientID %>").val(ids);
                return confirm("Đồng ý xóa.");
            }
        });
    });        
</script>
<asp:HiddenField runat="server" ID="hdfID" Value="" />
<div class="box">
    <!-- box / title -->
    <div class="title">
        <h5>
            Bình luận khuyến mãi</h5>
        <div class="search">
            <div class="input">
                <asp:TextBox ID="txtKeyword" runat="server" Text="Hãy nhập từ khóa !" onclick='if(this.value=="Hãy nhập từ khóa !")this.value=""'
                    onblur='if(this.value=="")this.value="Hãy nhập từ khóa !"' />
            </div>
            <div class="button">
                <asp:Button ID="btnSearch" runat="server" Text="Tìm Kiếm" OnClick="btnSearch_Click" />
            </div>
        </div>
    </div>
    <div id="divMessage" runat="server">
    </div>
    <div class="first-action">
        <div class="button">
            <asp:Button ID="Button1" runat="server" Text="Cập nhật" OnClick="btnUpdate_Click" />
            <asp:Button ID="Button3" runat="server" CssClass="del" Text="Xóa" OnClick="btnDel_Click" />
        </div>
        <div>
            <asp:DropDownList runat="server" ID="ddlRead" AutoPostBack="true" OnSelectedIndexChanged="ddlRead_SelectedIndexChanged">
                <asp:ListItem Text="Tất cả" Value="0"></asp:ListItem>
                <asp:ListItem Text="Đã duyệt" Value="1"></asp:ListItem>
                <asp:ListItem Text="Chưa duyệt" Value="2"></asp:ListItem>
            </asp:DropDownList>
        </div>
    </div>
    <!-- end box / title -->
    <div class="table">
        <table>
            <thead>
                <tr>
                    <th>
                        CT-Khuyến mãi
                    </th>
                    <th>
                        Tiêu đề
                    </th>
                    <th>
                        Email
                    </th>
                    <th>
                        Tên đầy đủ
                    </th>
                    <th>
                        Điện thoại
                    </th>
                    <th>
                        Địa chỉ
                    </th>
                    <th class="large">
                        Chi tiết
                    </th>
                    <th class="small">
                        Duyệt
                    </th>
                    <th class="selected last">
                        <input type="checkbox" class="checkall" />
                    </th>
                </tr>
            </thead>
            <tbody>
                <asp:Repeater ID="rptContact" runat="server">
                    <ItemTemplate>
                        <tr id='<%#Eval("COMMENT_ID")%>'>
                            <td class="left">
                                <%# DigiLib.StringUtils.Substring( Eval("DEAL_TITLE").ToString(),0,20) %>
                            </td>
                            <td class="left">
                                <%#Eval("TITLE")%>
                            </td>
                            <td class="left">
                                <%#Eval("EMAIL")%>
                            </td>
                            <td>
                                <%#Eval("FULL_NAME")%>
                            </td>
                            <td>
                                <%#Eval("MOBILE")%>
                            </td>
                            <td>
                                <%#Eval("ADDRESS")%>
                            </td>
                            <td>
                                <%#Eval("DETAIL")%>
                            </td>
                            <td>
                                <asp:CheckBox runat="server" ID="cboRead" Checked='<%#Eval("IS_APPROVED") %>' />
                                <asp:HiddenField runat="server" ID="hdf" Value='<%#Eval("COMMENT_ID") %>' />
                            </td>
                            <td align="center" class="last" style="vertical-align: middle">
                                <input type="checkbox" class="item" />
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </tbody>
        </table>
        <div class="pagination pagination-left">
            <div class="pagerContainer" id="pagerContainer" runat="server">
            </div>
        </div>
        <div class="action">
            <div class="button">
                <asp:Button ID="Button2" runat="server" Text="Cập nhật" OnClick="btnUpdate_Click" />
                <asp:Button ID="btnDel" CssClass="del" runat="server" Text="Xóa" OnClick="btnDel_Click" />
            </div>
        </div>
    </div>
</div>
<!-- end table -->
